/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

云硬盘相关接口
云硬盘相关接口，提供批量创建云硬盘，查询云硬盘，删除云硬盘，对云硬盘进行扩容，修改云硬盘信息以及使用快照恢复云硬盘等功能。

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>
#import <JDCloudOCSDKDisk/DiskApiModel.h>


@implementation DiskModifySnapshotAttributeRequest
-(id) initWithRegion:(NSString *)regionId
name:(NSString*)name
descriptionValue:(NSString*)descriptionValue
snapshotId:(NSString*)snapshotId { 
    self.regionId = regionId;
    self.name = name;
    self.descriptionValue = descriptionValue;
    self.snapshotId = snapshotId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
name:(NSString*)name
descriptionValue:(NSString*)descriptionValue
snapshotId:(NSString*)snapshotId { 
    self.regionId = regionId;
    self.version = version;
    self.name = name;
    self.descriptionValue = descriptionValue;
    self.snapshotId = snapshotId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    return self;
} 

@end
@implementation DiskCreateSnapshotResult
-(id) initWithSnapshotId:(NSString*) snapshotId { 
    self.snapshotId = snapshotId;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    return self;
} 

@end
@implementation DiskDeleteSnapshotRequest
-(id) initWithRegion:(NSString *)regionId
snapshotId:(NSString*)snapshotId { 
    self.regionId = regionId;
    self.snapshotId = snapshotId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
snapshotId:(NSString*)snapshotId { 
    self.regionId = regionId;
    self.version = version;
    self.snapshotId = snapshotId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    return self;
} 

@end
@implementation DiskDescribeSnapshotRequest
-(id) initWithRegion:(NSString *)regionId
snapshotId:(NSString*)snapshotId { 
    self.regionId = regionId;
    self.snapshotId = snapshotId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
snapshotId:(NSString*)snapshotId { 
    self.regionId = regionId;
    self.version = version;
    self.snapshotId = snapshotId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    return self;
} 

@end
@implementation DiskRestoreDiskRequest
-(id) initWithRegion:(NSString *)regionId
snapshotId:(NSString*)snapshotId
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.snapshotId = snapshotId;
    self.diskId = diskId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
snapshotId:(NSString*)snapshotId
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.version = version;
    self.snapshotId = snapshotId;
    self.diskId = diskId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    self.diskId = [dictionary objectForKey:@"diskId"];
    return self;
} 

@end
@implementation DiskDescribeDiskRequest
-(id) initWithRegion:(NSString *)regionId
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.diskId = diskId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.version = version;
    self.diskId = diskId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskId = [dictionary objectForKey:@"diskId"];
    return self;
} 

@end
@implementation DiskCreateDisksResult
-(id) initWithDiskIds:(NSArray<NSString*>*) diskIds { 
    self.diskIds = diskIds;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskIds])
    {
        [result setValue:[self diskIds] forKey:@"diskIds"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskIds = [dictionary objectForKey:@"diskIds"];
    return self;
} 

@end
@implementation DiskExtendDiskRequest
-(id) initWithRegion:(NSString *)regionId
diskSizeGB:(NSNumber*)diskSizeGB
iops:(NSNumber*)iops
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.diskSizeGB = diskSizeGB;
    self.iops = iops;
    self.diskId = diskId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
diskSizeGB:(NSNumber*)diskSizeGB
iops:(NSNumber*)iops
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.version = version;
    self.diskSizeGB = diskSizeGB;
    self.iops = iops;
    self.diskId = diskId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self diskSizeGB])
    {
        [result setValue:[self diskSizeGB] forKey:@"diskSizeGB"];
    }
    if([self iops])
    {
        [result setValue:[self iops] forKey:@"iops"];
    }
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskSizeGB = [dictionary objectForKey:@"diskSizeGB"];
    self.iops = [dictionary objectForKey:@"iops"];
    self.diskId = [dictionary objectForKey:@"diskId"];
    return self;
} 

@end
@implementation DiskDeleteDiskRequest
-(id) initWithRegion:(NSString *)regionId
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.diskId = diskId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.version = version;
    self.diskId = diskId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskId = [dictionary objectForKey:@"diskId"];
    return self;
} 

@end
@implementation DiskModifyDiskAttributeRequest
-(id) initWithRegion:(NSString *)regionId
name:(NSString*)name
descriptionValue:(NSString*)descriptionValue
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.name = name;
    self.descriptionValue = descriptionValue;
    self.diskId = diskId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
name:(NSString*)name
descriptionValue:(NSString*)descriptionValue
diskId:(NSString*)diskId { 
    self.regionId = regionId;
    self.version = version;
    self.name = name;
    self.descriptionValue = descriptionValue;
    self.diskId = diskId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.diskId = [dictionary objectForKey:@"diskId"];
    return self;
} 

@end
@implementation DiskDescribeSnapshotResult
-(id) initWithSnapshot:(Snapshot*) snapshot { 
    self.snapshot = snapshot;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self snapshot])
    {
        [result setValue:[[self snapshot] dictionary]forKey:@"snapshot"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.snapshot = [[Snapshot alloc]initWithDic:[dictionary objectForKey:@"snapshot"]];
    return self;
} 

@end
  
@implementation DiskDescribeSnapshotResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskDescribeSnapshotResult* result = [[DiskDescribeSnapshotResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskDescribeSnapshotResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation DiskDeleteSnapshotResult
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    return self;
} 

@end
@implementation DiskModifySnapshotAttributeResult
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    return self;
} 

@end
  
@implementation DiskCreateSnapshotResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskCreateSnapshotResult* result = [[DiskCreateSnapshotResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskCreateSnapshotResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation DiskModifySnapshotAttributeResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskModifySnapshotAttributeResult* result = [[DiskModifySnapshotAttributeResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskModifySnapshotAttributeResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation DiskDescribeSnapshotsResult
-(id) initWithSnapshots:(NSArray<Snapshot*>*) snapshots
        totalCount:(NSNumber*)totalCount { 
    self.snapshots = snapshots;               
    self.totalCount = totalCount;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self snapshots])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self snapshots] count]; i++) {
            Snapshot* item = [[self snapshots] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"snapshots"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* snapshotsArray = [dictionary objectForKey:@"snapshots"];
    if(snapshotsArray&&![snapshotsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [snapshotsArray count];i++)
        {
        Snapshot* item = [[Snapshot alloc]initWithDic:[snapshotsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.snapshots = propertyArray;
    }
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    return self;
} 

@end
  
@implementation DiskDescribeSnapshotsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskDescribeSnapshotsResult* result = [[DiskDescribeSnapshotsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskDescribeSnapshotsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation DiskDeleteSnapshotResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskDeleteSnapshotResult* result = [[DiskDeleteSnapshotResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskDeleteSnapshotResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation DiskDescribeSnapshotsRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
snapshotSource:(NSString*)snapshotSource
filters:(NSArray<Filter*>*)filters { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.snapshotSource = snapshotSource;
    self.filters = filters;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
snapshotSource:(NSString*)snapshotSource
filters:(NSArray<Filter*>*)filters { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.snapshotSource = snapshotSource;
    self.filters = filters;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self snapshotSource])
    {
        [result setValue:[self snapshotSource] forKey:@"snapshotSource"];
    }
    if([self filters])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self filters] count]; i++) {
            Filter* item = [[self filters] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"filters"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.snapshotSource = [dictionary objectForKey:@"snapshotSource"];
    NSArray* filtersArray = [dictionary objectForKey:@"filters"];
    if(filtersArray&&![filtersArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [filtersArray count];i++)
        {
        Filter* item = [[Filter alloc]initWithDic:[filtersArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.filters = propertyArray;
    }
    return self;
} 

@end
@implementation DiskCreateSnapshotRequest
-(id) initWithRegion:(NSString *)regionId
snapshotSpec:(SnapshotSpec*)snapshotSpec
clientToken:(NSString*)clientToken { 
    self.regionId = regionId;
    self.snapshotSpec = snapshotSpec;
    self.clientToken = clientToken;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
snapshotSpec:(SnapshotSpec*)snapshotSpec
clientToken:(NSString*)clientToken { 
    self.regionId = regionId;
    self.version = version;
    self.snapshotSpec = snapshotSpec;
    self.clientToken = clientToken;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self snapshotSpec])
    {
        [result setValue:[[self snapshotSpec] dictionary]forKey:@"snapshotSpec"];
    }
    if([self clientToken])
    {
        [result setValue:[self clientToken] forKey:@"clientToken"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.snapshotSpec = [[SnapshotSpec alloc]initWithDic:[dictionary objectForKey:@"snapshotSpec"]];
    self.clientToken = [dictionary objectForKey:@"clientToken"];
    return self;
} 

@end
@implementation DiskExtendDiskResult
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    return self;
} 

@end
  
@implementation DiskExtendDiskResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskExtendDiskResult* result = [[DiskExtendDiskResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskExtendDiskResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation DiskRestoreDiskResult
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    return self;
} 

@end
  
@implementation DiskRestoreDiskResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskRestoreDiskResult* result = [[DiskRestoreDiskResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskRestoreDiskResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation DiskDeleteDiskResult
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    return self;
} 

@end
@implementation DiskDescribeDiskResult
-(id) initWithDisk:(Disk*) disk { 
    self.disk = disk;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self disk])
    {
        [result setValue:[[self disk] dictionary]forKey:@"disk"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.disk = [[Disk alloc]initWithDic:[dictionary objectForKey:@"disk"]];
    return self;
} 

@end
@implementation DiskModifyDiskAttributeResult
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    return self;
} 

@end
  
@implementation DiskDescribeDiskResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskDescribeDiskResult* result = [[DiskDescribeDiskResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskDescribeDiskResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation DiskDeleteDiskResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskDeleteDiskResult* result = [[DiskDeleteDiskResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskDeleteDiskResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation DiskCreateDisksRequest
-(id) initWithRegion:(NSString *)regionId
diskSpec:(DiskSpec*)diskSpec
maxCount:(NSNumber*)maxCount
clientToken:(NSString*)clientToken { 
    self.regionId = regionId;
    self.diskSpec = diskSpec;
    self.maxCount = maxCount;
    self.clientToken = clientToken;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
diskSpec:(DiskSpec*)diskSpec
maxCount:(NSNumber*)maxCount
clientToken:(NSString*)clientToken { 
    self.regionId = regionId;
    self.version = version;
    self.diskSpec = diskSpec;
    self.maxCount = maxCount;
    self.clientToken = clientToken;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self diskSpec])
    {
        [result setValue:[[self diskSpec] dictionary]forKey:@"diskSpec"];
    }
    if([self maxCount])
    {
        [result setValue:[self maxCount] forKey:@"maxCount"];
    }
    if([self clientToken])
    {
        [result setValue:[self clientToken] forKey:@"clientToken"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskSpec = [[DiskSpec alloc]initWithDic:[dictionary objectForKey:@"diskSpec"]];
    self.maxCount = [dictionary objectForKey:@"maxCount"];
    self.clientToken = [dictionary objectForKey:@"clientToken"];
    return self;
} 

@end
@implementation DiskDescribeDisksResult
-(id) initWithDisks:(NSArray<Disk*>*) disks
        totalCount:(NSNumber*)totalCount { 
    self.disks = disks;               
    self.totalCount = totalCount;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self disks])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self disks] count]; i++) {
            Disk* item = [[self disks] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"disks"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* disksArray = [dictionary objectForKey:@"disks"];
    if(disksArray&&![disksArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [disksArray count];i++)
        {
        Disk* item = [[Disk alloc]initWithDic:[disksArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.disks = propertyArray;
    }
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    return self;
} 

@end
  
@implementation DiskDescribeDisksResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskDescribeDisksResult* result = [[DiskDescribeDisksResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskDescribeDisksResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation DiskCreateDisksResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskCreateDisksResult* result = [[DiskCreateDisksResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskCreateDisksResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation DiskModifyDiskAttributeResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
DiskModifyDiskAttributeResult* result = [[DiskModifyDiskAttributeResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(DiskModifyDiskAttributeResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation DiskDescribeDisksRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
tags:(NSArray<DiskTagFilter*>*)tags
filters:(NSArray<Filter*>*)filters { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.tags = tags;
    self.filters = filters;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
tags:(NSArray<DiskTagFilter*>*)tags
filters:(NSArray<Filter*>*)filters { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.tags = tags;
    self.filters = filters;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self tags])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self tags] count]; i++) {
            DiskTagFilter* item = [[self tags] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"tags"];
    }
    if([self filters])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self filters] count]; i++) {
            Filter* item = [[self filters] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"filters"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    NSArray* tagsArray = [dictionary objectForKey:@"tags"];
    if(tagsArray&&![tagsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [tagsArray count];i++)
        {
        DiskTagFilter* item = [[DiskTagFilter alloc]initWithDic:[tagsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.tags = propertyArray;
    }
    NSArray* filtersArray = [dictionary objectForKey:@"filters"];
    if(filtersArray&&![filtersArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [filtersArray count];i++)
        {
        Filter* item = [[Filter alloc]initWithDic:[filtersArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.filters = propertyArray;
    }
    return self;
} 

@end
 
